package com.ebolib.base;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ebo.corelib.ui.SimpleBaseFragment;


public abstract class MVPBaseFragment<T extends BasePresenter, M extends BaseModel> extends SimpleBaseFragment {
    public T mPresenter;
    public M mModel;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mPresenter = CreateUtil.getT(this,0);
        mModel = CreateUtil.getT(this,1);
        mPresenter.attachModelView(mModel,this);
        return super.onCreateView(inflater, container, savedInstanceState);
    }


    @Override
    public void onDetach() {
        super.onDetach();
        mPresenter.onDettach();
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
    }

    public abstract void initView();
}
